/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/*******************************************************************************
    FILE NAME:		arch.h

    PROJECT:		Linux ECAN527/1000 driver, library, and sample programs

    FILE DESCRIPTION:	This header file contains architecture-dependent
    			definitions.

    Copyright (c) 2004 RTD Embedded Technologies, Inc.

    For driver version, compiler, and target information, please refer to the
    file README.TXT.
*******************************************************************************/

#ifndef  _ECAN_ARCH_H
# define _ECAN_ARCH_H

# if   #cpu(1750a)
#  define BYTE_BITS 16
#  include <arch_16.h>
#  undef __8_T

# elif #cpu(a29k)
#  include <arch_32.h>

# elif #cpu(alpha)
#  include <arch_64.h>

# elif #cpu(arc)
#  include <arch_32.h>

# elif #cpu(arm)
#  include <arch_32.h>

# elif #cpu(c4x)	/* TMS320C[34]x */
#  define BYTE_BITS 32
#  include <arch_32.h>
#  undef __8_T
#  undef __16_T

# elif #cpu(clipper)
#  include <arch_32.h>

# elif #cpu(convex)
#  define __WORD_T   long long
#  define __INTPTR_T int
#  include <arch_64.h>

# elif #cpu(dsp16xx)
#  define BYTE_BITS 16
#  include <arch_16.h>
#  undef __8_T
#  undef __64_T

# elif #cpu(elxsi)
#  define __WORD_T  long long
#  include <arch_32.h>

# elif #cpu(tron)
#  include <arch_32.h>

# elif #cpu(h8300)
#  include <arch_16.h>
#  undef __64_T

# elif #cpu(h8300h) || #cpu(h8300s)
#  include <arch_32.h>
#  undef __64_T

# elif #cpu(i370)
#  include <arch_32.h>

# elif #cpu(i386)
#  include <arch_32.h>

# elif #cpu(i860)
#  include <arch_32.h>

# elif #cpu(i960)
#  include <arch_32.h>

# elif #cpu(m32r)
#  include <arch_32.h>

# elif #cpu(m68k)
#  define __WORD_T    long
#  define __INTPTR_T  long
#  include <arch_16.h>

# elif #cpu(m88k)
#  include <arch_32.h>


# elif #cpu(mips)
#  define BYTE_BITS  8

#  if defined(__mips64)
#   define __WORD_T   __64_T
#  else
#   define __WORD_T   int
#  endif

#  if _MIPS_SZPTR==64 || _MIPS_SZINT==64
#   define __INTPTR_T __64_T
#  else
#   define __INTPTR_T int
#  endif

#  define __8_T  char
#  define __16_T short

#  if _MIPS_SZINT==32
#   define __32_T int
#  else
#   undef  __32_T
#  endif

#  if _MIPS_SZLONG==64
#   define __64_T long
#  else
#   define __64_T long long
#  endif


# elif #cpu(ns32k)
#  include <arch_32.h>

# elif #cpu(hppa)
#  include <arch_32.h>

# elif #cpu(pdp11)
#  include <arch_16.h>

# elif #cpu(pyr)
#  include <arch_32.h>

# elif #cpu(ibm032)
#  include <arch_32.h>

/* # elif #cpu(rs6000) || ppc - too complex */

# elif #cpu(sh)
#  include <arch_32.h>

# elif #cpu(sparc)
#  include <arch_32.h>

# elif #cpu(sparc64)
#  include <arch_64.h>

# elif #cpu(spur)
#  include <arch_32.h>

# elif #cpu(tahoe)
#  include <arch_32.h>

# elif #cpu(v850)
#  include <arch_32.h>

# elif #cpu(vax)
#  include <arch_32.h>

# elif #cpu(we32000)
#  include <arch_32.h>

# else
#  include <arch_64.h>
#  warning Unknown CPU specified, Using 64bits defaults ( This will probably fail :)
//#  error This CPU not supported yet

# endif


# ifndef  WORD_BITS
#  define WORD_BITS	( sizeof(__WORD_T) * BYTE_BITS )
# endif

# ifndef  PTR_BITS
#  define PTR_BITS	( sizeof(void*)  * BYTE_BITS )
# endif


#endif	/* _ECAN_ARCH_H */
